﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Warensoft.Unity.Communication.Client.Contracts
{
    public abstract class MessageBase:IMessage
    {
        public Dictionary<string,object> Properties { get; set; }
       
        public MessageBase()
        {
            this.Properties = new Dictionary<string, object>();
        }
        public MessageBase(byte[] buffer)
        {
            this.Properties = new Dictionary<string, object>();
            this.FillProperties(buffer);
        }
        public abstract byte[] ToArray();
        protected abstract void FillProperties(byte[]buffer);
    }
}
